/**
 * Created by Shinelon on 2016/9/22.
 */
//Fig . 3.18:NameDialog.java
    //Basic javax.swing.JOptionPane
    import  javax.swing.JOptionPane;
    import java.util.Scanner;

public class NameDialog {
    public static void main (String[] args){
        //prompt user to enter name
        String name =
                JOptionPane.showInputDialog("What is your name?");

        //create the message
        String message =
                String.format("Welcome,%s,to Java Programming",name);
        //display the message to welcome the user by name
        JOptionPane.showMessageDialog(null,message);
    }//end main
}//end class NameDialog
